<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <base href="<%=basePath%>">   
  <title>My JSP 'listNews.JSP' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="js/jquery.min.js"></script>
  </head>
  
  <body>
    This is my showNews page. <br>
    <hr>
    <h1></h1>
    <script type="text/javascript"> 
    //新闻列表分页
    var i=0;
    var title;
    var str=this.location.href;
	var myArray = new Array()
	myArray =str.split("=");
	
	$.ajax({
   		url: "showNewsAction.do",
   		type:'jsonp',
   		success: function(msg){
		for(i=0;i<msg.toString().length;i++){
		if(msg.news[i].id==myArray[1]){
			$("h1").append("<h6>"
				+i+msg.news[i].id
				+msg.news[i].title
				+msg.news[i].author
				+msg.news[i].date.toString()
				+msg.news[i].content
				+"</a></h6>");
		} 		
	     	}
   		}
	});
</script>
</body>
</html>
